<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp"%>
<%
	//查询科室id
	String userId = input.getDesc("userId","-1");//员工号
	String yydm =  input.getDesc("yydm","02");//医院代码	
	if(userId.equals("liqun")){
		//userId = "03126 ";
		userId = "00203 ";
		//userId = "00206 ";
	}
	if(userId.equals("litl")){
		//userId = "03126 ";
		userId = "01209 ";
		//userId = "01209 ";
	}
	if(userId.equals("chenqy")){
		userId = "00203 ";
		userId = "01209 ";
	}
	if(userId.equals("chenyf")){
		userId = "91252 ";
		 
	}
	if(userId.equals("dujf")){
		userId = "01209 ";
		//userId = "00205 ";
	}
	if(userId.equals("hecf")){
		userId = "03126 ";
	}
	if(userId.equals("hecfx")){
		userId = "01209 ";
	}
	if(userId.equals("shixm")){
		userId = "69101 ";
	}
	if(userId.equals("chenqyx")){
		userId = "03227 ";
	}
	//System.out.println(userId);
	List<Map> lis = QBuilder.db("basedb").queryHql("select new map (ks_id as ks_id) from VW_YSBQKSDYK where id ='" + userId + "'  and ks_id in (select id  from his_dept where yydm ='"+yydm+"') ");
	String ksdm = lis != null && lis.size()>0 ? "0" : "-1";
	if("-1".equals(userId)){
		//如果userId没有传入 或者传入-1  让ksdm =-1
		ksdm = "-1";
	}else{
		
		for(Map map : lis){
			if(map.get("ks_id") == null || map.get("ks_id").toString().equals("")){
				continue;
			}
			ksdm +="," +map.get("ks_id").toString();
		}
	}
	
	//System.out.println(ksdm);
	Message msg = new Message();
	msg.put("errcode",0);
	msg.put("data",ksdm);
	out.println(msg);
%>